package kr.co.doriclassic.chapter25test;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;

public class URLConnectionReader {
	public static void main(String[] args) throws Exception {
		URL naver = new URL("http://naver.com");
		URLConnection uc = naver.openConnection();
		BufferedReader br = new BufferedReader(new InputStreamReader(uc.getInputStream()));
		String inLine;
		while ((inLine=br.readLine())!=null) {
			System.out.println(inLine);	
		}
		br.close();
	}
}